package com.guotai.meet.utils;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

public class URLUtils {
	
	/**
	 * URLDecoder编码，处理表情
	 * @param str
	 * @return
	 */
	public static String decode(String str){
		String code="";
		try {
			code=URLDecoder.decode(str, "UTF-8");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		return code;
	}
	
	/**
	 * URLEncoder解码
	 * @param str
	 * @return
	 */
	public static String enode(String str){
		String code="";
		try {
			code=URLEncoder.encode(str, "UTF-8");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		return code;
	}
	
	
}
